using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class UDF_PKT_HeaderMap : EntityTypeConfiguration<UDF_PKT_Header>
    {
        public UDF_PKT_HeaderMap()
        {
            // Primary Key
            this.HasKey(t => t.SPID);

            // Properties
            this.Property(t => t.SPID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Value1)
                .HasMaxLength(1000);

            this.Property(t => t.Value2)
                .HasMaxLength(1000);

            this.Property(t => t.Value3)
                .HasMaxLength(1000);

            // Table & Column Mappings
            this.ToTable("UDF_PKT_Header");
            this.Property(t => t.SPID).HasColumnName("SPID");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Value1).HasColumnName("Value1");
            this.Property(t => t.Value2).HasColumnName("Value2");
            this.Property(t => t.Value3).HasColumnName("Value3");
        }
    }
}
